package com.cx.controller;

import com.cx.pojo.Employee;
import com.cx.service.impl.EmployeeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/employee")
public class EmployeeServlet {

    @Autowired
    private EmployeeServiceImpl employeeServiceImpl;

    @GetMapping
    public List<Employee> findAll(){
        List<Employee> list = employeeServiceImpl.findAll();
        return list;

    }
}
